.class public Lcom/donson/momark/b/w;
.super Ljava/lang/Object;


# direct methods
.method private static a(Ljava/lang/String;Lcom/donson/momark/a/r;)Ljava/lang/String;
    .locals 3

    sget-object v0, Lcom/donson/momark/util/e;->o:Ljava/lang/String;

    new-instance v1, Ljava/lang/StringBuffer;

    invoke-direct {v1}, Ljava/lang/StringBuffer;-><init>()V

    sget-object v2, Lcom/donson/momark/util/e;->a:Ljava/lang/String;

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-virtual {v1, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    :cond_0
    :goto_0
    invoke-virtual {v1}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0

    :cond_1
    sget-object v0, Lcom/donson/momark/util/e;->h:Ljava/lang/String;

    invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    sget-object v0, Lcom/donson/momark/util/e;->p:Ljava/lang/String;

    invoke-virtual {v1, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    goto :goto_0

    :cond_2
    sget-object v0, Lcom/donson/momark/util/e;->j:Ljava/lang/String;

    invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    sget-object v0, Lcom/donson/momark/util/e;->q:Ljava/lang/String;

    invoke-virtual {v1, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    goto :goto_0

    :cond_3
    sget-object v0, Lcom/donson/momark/util/e;->b:Ljava/lang/String;

    invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_4

    sget-object v0, Lcom/donson/momark/util/e;->r:Ljava/lang/String;

    invoke-virtual {v1, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    goto :goto_0

    :cond_4
    sget-object v0, Lcom/donson/momark/util/e;->c:Ljava/lang/String;

    invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    sget-object v0, Lcom/donson/momark/util/e;->s:Ljava/lang/String;

    invoke-virtual {v1, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    goto :goto_0
.end method

.method public static final a()Lorg/apache/http/params/HttpParams;
    .locals 3

    const/16 v2, 0x7530

    new-instance v0, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v0}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lorg/apache/http/params/HttpConnectionParams;->setStaleCheckingEnabled(Lorg/apache/http/params/HttpParams;Z)V

    invoke-static {v0, v2}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    invoke-static {v0, v2}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    const v1, 0xa000

    invoke-static {v0, v1}, Lorg/apache/http/params/HttpConnectionParams;->setSocketBufferSize(Lorg/apache/http/params/HttpParams;I)V

    return-object v0
.end method

.method public static a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/donson/momark/a/r;Lcom/donson/momark/a/u;)V
    .locals 4

    invoke-static {p0}, Lcom/donson/momark/b/a;->a(Landroid/content/Context;)Z

    move-result v0

    if-nez v0, :cond_1

    const-string v0, " sendcommand.sendHttpCommand 40012:not wifi or net,send command to host."

    invoke-static {v0}, Lcom/donson/momark/util/t;->a(Ljava/lang/String;)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    const-string v0, "**"

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "----------------sendCommand.sendHttpCommand---------"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/donson/momark/util/t;->a(Ljava/lang/String;)V

    invoke-static {p1, p3}, Lcom/donson/momark/b/w;->a(Ljava/lang/String;Lcom/donson/momark/a/r;)Ljava/lang/String;

    move-result-object v0

    new-instance v1, Lorg/apache/http/client/methods/HttpPost;

    invoke-direct {v1, v0}, Lorg/apache/http/client/methods/HttpPost;-><init>(Ljava/lang/String;)V

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "----------------sendCommand.sendHttpCommand---------"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/donson/momark/util/t;->a(Ljava/lang/String;)V

    invoke-static {}, Lcom/donson/momark/b/w;->a()Lorg/apache/http/params/HttpParams;

    move-result-object v0

    invoke-virtual {v1, v0}, Lorg/apache/http/client/methods/HttpPost;->setParams(Lorg/apache/http/params/HttpParams;)V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "d"

    invoke-direct {v2, v3, p2}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :try_start_0
    new-instance v2, Lorg/apache/http/client/entity/UrlEncodedFormEntity;

    const-string v3, "UTF-8"

    invoke-direct {v2, v0, v3}, Lorg/apache/http/client/entity/UrlEncodedFormEntity;-><init>(Ljava/util/List;Ljava/lang/String;)V

    invoke-virtual {v1, v2}, Lorg/apache/http/client/methods/HttpPost;->setEntity(Lorg/apache/http/HttpEntity;)V

    new-instance v0, Lorg/apache/http/impl/client/DefaultHttpClient;

    invoke-direct {v0}, Lorg/apache/http/impl/client/DefaultHttpClient;-><init>()V

    invoke-virtual {v0, v1}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v0

    invoke-interface {v0}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;

    move-result-object v1

    invoke-interface {v1}, Lorg/apache/http/StatusLine;->getStatusCode()I

    move-result v1

    const/16 v2, 0xc8

    if-ne v1, v2, :cond_2

    invoke-interface {v0}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v0

    const-string v1, "UTF-8"

    invoke-static {v0, v1}, Lorg/apache/http/util/EntityUtils;->toString(Lorg/apache/http/HttpEntity;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {p0, v0, p1, p3, p4}, Lcom/donson/momark/b/q;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/donson/momark/a/r;Lcom/donson/momark/a/u;)V
    :try_end_0
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/net/UnknownHostException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Lorg/apache/http/ParseException; {:try_start_0 .. :try_end_0} :catch_2
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_3

    goto :goto_0

    :catch_0
    move-exception v0

    const-string v1, " sendcommand.sendHttpCommand 40002:Characters converter is not available."

    invoke-static {v1, v0}, Lcom/donson/momark/util/t;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    sget-object v0, Lcom/donson/momark/util/e;->h:Ljava/lang/String;

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Lcom/donson/momark/a/a/y;

    const v1, 0x9c42

    invoke-direct {v0, v1}, Lcom/donson/momark/a/a/y;-><init>(I)V

    invoke-virtual {p4, v0}, Lcom/donson/momark/a/u;->a(Lcom/donson/momark/a/a/y;)V

    goto/16 :goto_0

    :cond_2
    :try_start_1
    const-string v0, " sendcommand.sendHttpCommand 40010:request fail\uff0cstate not 200."

    invoke-static {v0}, Lcom/donson/momark/util/t;->a(Ljava/lang/String;)V

    sget-object v0, Lcom/donson/momark/util/e;->h:Ljava/lang/String;

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Lcom/donson/momark/a/a/y;

    const v1, 0x9c4a

    invoke-direct {v0, v1}, Lcom/donson/momark/a/a/y;-><init>(I)V

    invoke-virtual {p4, v0}, Lcom/donson/momark/a/u;->a(Lcom/donson/momark/a/a/y;)V
    :try_end_1
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/net/UnknownHostException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Lorg/apache/http/ParseException; {:try_start_1 .. :try_end_1} :catch_2
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_3

    goto/16 :goto_0

    :catch_1
    move-exception v0

    const-string v1, " sendcommand.sendHttpCommand 40001:host not find."

    invoke-static {v1, v0}, Lcom/donson/momark/util/t;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    sget-object v0, Lcom/donson/momark/util/e;->h:Ljava/lang/String;

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Lcom/donson/momark/a/a/y;

    const v1, 0x9c41

    invoke-direct {v0, v1}, Lcom/donson/momark/a/a/y;-><init>(I)V

    invoke-virtual {p4, v0}, Lcom/donson/momark/a/u;->a(Lcom/donson/momark/a/a/y;)V

    goto/16 :goto_0

    :catch_2
    move-exception v0

    const-string v1, " sendcommand.sendHttpCommand 40003:Characters parse error."

    invoke-static {v1, v0}, Lcom/donson/momark/util/t;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    sget-object v0, Lcom/donson/momark/util/e;->h:Ljava/lang/String;

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Lcom/donson/momark/a/a/y;

    const v1, 0x9c43

    invoke-direct {v0, v1}, Lcom/donson/momark/a/a/y;-><init>(I)V

    invoke-virtual {p4, v0}, Lcom/donson/momark/a/u;->a(Lcom/donson/momark/a/a/y;)V

    goto/16 :goto_0

    :catch_3
    move-exception v0

    const-string v1, " sendcommand.sendHttpCommand 40004:IOException."

    invoke-static {v1, v0}, Lcom/donson/momark/util/t;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    sget-object v0, Lcom/donson/momark/util/e;->h:Ljava/lang/String;

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Lcom/donson/momark/a/a/y;

    const v1, 0x9c44

    invoke-direct {v0, v1}, Lcom/donson/momark/a/a/y;-><init>(I)V

    invoke-virtual {p4, v0}, Lcom/donson/momark/a/u;->a(Lcom/donson/momark/a/a/y;)V

    goto/16 :goto_0
.end method
